package com.quectel.core.module.workorder.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 工单操作流水
 *
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2021-10-19 13:06:44
 */
@Data
@Schema
public class WorkOrderLogDto implements Serializable, Comparable<WorkOrderLogDto> {

    /**
     * ID
     */
    @Schema(description = "ID")
    private Long id;

    /**
     * 工单id
     */
    @Schema(description = "工单id")
    private Long workOrderId;

    /**
     * 从1开始
     */
    @Schema(description = "从1开始")
    private Integer seq;

    /**
     * 1管理员2员工
     */
    @Schema(description = "1管理员2员工")
    private Byte handlerType;


    /**
     * 当前经办人id
     */
    @Schema(description = "当前经办人id")
    private Long handlerId;

    /**
     * 状态，0未处理；1已接单；2已流转 3已完成 4已完结
     */
    @Schema(description = "状态，0未处理；1已接单；2已流转 3已完成 4已完结")
    private Byte orderStatus;

    /**
     * 当前节点处理描述
     */
    @Schema(description = "当前节点处理描述")
    private String orderDes;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date createTime;

    /************非数据库字段 start ************/


    @Schema(description = "状态名称")
    private String orderStatusName;

    /**
     * 当前经办人用户名
     */
    @Schema(description = "当前经办人用户名")
    private String handlerUsername;

    /**
     * 当前经办人用户名
     */
    @Schema(description = "当前经办人手机号")
    private String handlerMobile;


    /************非数据库字段 end **************/

    @Override
    public int compareTo(WorkOrderLogDto o) {
        if (o.getSeq() != null && this.seq != null) {
            return this.seq - o.getSeq();
        }
        return 0;
    }
}
